﻿/********************************************************************************************************************
* Author:	Christos Polydorou																						*
* Email:	std04237@di.uoa.gr																						*
* Purpose:	This script is used in order to create the "Category-User" table that holds all categories and the		*
*			users that are invited from the owner of the category to view the category.								*
********************************************************************************************************************/

CREATE TABLE [dbo].[Category-User]
(
	CategoryID bigint NOT NULL, 
	UserID bigint NOT NULL,
	FOREIGN KEY (CategoryID) REFERENCES Categories(ID),
	FOREIGN KEY (UserID) REFERENCES Users(ID),
	CONSTRAINT OnlyOnePair UNIQUE (CategoryID,UserID)
)
